<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>工单查询</title>
	<meta name="decorator" content="default"/>
	<script src="/static/common/Datefmt.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {

		    var triggerQry = function(){
		        $("#btnSubmit").trigger("click");
		    };
            $("#weekQry").click(function(){
                var today = new Date();
                today.setDate(today.getDate() - 7);
                var beginDateVal = today.Format("yyyy-MM-dd");
                $("#beginDate").val(beginDateVal);
                triggerQry();
            });
            $("#monthQry").click(function(){
                var today = new Date();
                today.setMonth(today.getMonth() - 1);
                 var beginDateVal = today.Format("yyyy-MM-dd");
                $("#beginDate").val(beginDateVal);
                triggerQry();
            });

		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/oa/orderQry">工单查询</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="orderQryVo" action="${ctx}/oa/orderQry" method="get" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>

		<ul class="ul-form">
			<li><label>主办人：</label>
				<form:input path="organiserName" htmlEscape="false" maxlength="200" class="input-medium"/>
			</li>
			<li><label>协办人：</label>
			    <form:input path="coOrganiserName" htmlEscape="false" maxlength="200" class="input-medium"/>
            </li>
			<li><label>状态：</label>
			    <form:select path="status" class="input-medium">
            	    <form:option value="" label=""/>
            		<form:options items="${fns:getDictList('order_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </li>

			<li><label>派单时间：</label>

			<input id="beginDate"  name="beginDate"  type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" style="width:163px;"
				value="<fmt:formatDate value="${orderQryVo.beginDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/>
				　--　
			<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" style="width:163px;"
				value="<fmt:formatDate value="${orderQryVo.endDate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" />

			</li>

            <li><label>最近：</label>
				<a id="weekQry" href="javascript:">一周</a>
				<a id="monthQry"  href="javascript:">一个月</a>
			</li>

			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>主办人</th>
				<th>协办人</th>
				<th>主题</th>
				<th>派单内容</th>
				<th>回单时间</th>
				<th>派单时间</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="orderQryVo">
			<tr>
				<td>${orderQryVo.rn}</td>
				<td>${orderQryVo.organiserName}</td>
				<td>${orderQryVo.coOrganiserName}</td>
				<td>${orderQryVo.workOrderSubject}</td>
				<td>${orderQryVo.workOrderContent}</td>
				<td><fmt:formatDate value="${orderQryVo.lastHanderDate}" pattern="yyyy-MM-dd"/></td>
				<td><fmt:formatDate value="${orderQryVo.createDate}" pattern="yyyy-MM-dd"/></td>
				</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>